<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!--  求一个三位数，叫做“喇叭花数”，该三位数等与其每位数字的阶乘之和。输出100~999的所有喇叭花数。 -->
    <script>
        for (var i = 100; i <= 999; i++) {
            var ge = parseInt(i % 10);
            var shi = parseInt(i / 10) % 10;
            var bai = parseInt(i / 100) % 100;
            if (i == fibo(ge) + fibo(shi) + fibo(bai)) {
                console.log(i);
            }
        }
        function fibo(a){
            var sum = 1;
            for (var i = 1; i <= a; i++){
                sum *= i;
            }
            return sum;
            }
    </script>
</body>
</html>